package UI
{
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class UILable extends Sprite
	{
		public var mText:TextField=null;
		public var mWidth:Number=0;
		public var mHeight:Number=0;
		public function UILable()
		{
			super();
		}
		
		public function Create(x:int,y:int,w:int,h:int,caption:String):Boolean
		{
			this.x=x;
			this.y=y;
			mWidth=w;
			mHeight=h;
			
			mText=new TextField;
			addChild(mText);
			mText.defaultTextFormat=UIManager.msInstance.mUITextFormat;
			mText.textColor=0x111111;
			mText.cacheAsBitmap=true;
			mText.x=0;
			mText.y=0;
			mText.width=w;
			mText.height=h;
			mText.selectable=false;
			
			setCaption(caption);
			return true;
		}
		
		public function setCaption(caption:String):void
		{
			mText.text=caption;
		}
	}
}